import request from '@/utils/request'

// 查询发票抬头全部列表
export function invoiceListAll() {
  return request({
    url: '/basic/invoiceHeader/listing',
    method: 'get',
  })
}

// 分页查询发票抬头列表
export function invoiceList(params) {
  return request({
    url: '/basic/invoiceHeader/list',
    method: 'get',
    params: params,
  })
}

// 查询发票抬头详情
export function invoiceDetail(invoiceHeaderId) {
  return request({
    url: `/basic/invoiceHeader/${invoiceHeaderId}`,
    method: 'get',
  })
}

// 新增发票抬头
export function invoiceAdd(data) {
  return request({
    url: `/basic/invoiceHeader/add`,
    method: 'post',
    data: data
  })
}

// 修改发票抬头
export function invoiceEdit(data) {
  return request({
    url: `/basic/invoiceHeader/edit`,
    method: 'post',
    data: data
  })
}

// 删除发票抬头
export function invoiceDelete(invoiceHeaderIds) {
  return request({
    url: `/basic/invoiceHeader/remove/${invoiceHeaderIds}`,
    method: 'get',
  })
}

// 通过单位ID获取发票抬头详情
export function invoiceDetailByOrganizationId(organizationId) {
  return request({
    url: `/basic/invoiceHeader/getInfoByOrganizationId/${organizationId}`,
    method: 'get',
  })
}
